<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
		StringBuffer errorString=new StringBuffer("");
		if (request.getParameter("false") != null)
		{
			errorString.append("问题模板不正确！\\n");
		}
		if (request.getParameter("ext") != null)
		{
			errorString.append("只能上传Excel文件！ \\n");
		}
		if (request.getParameter("okc") != null)
		{
			errorString.append("成功导入"+request.getParameter("okc")+"道问题！ \\n");
		}
		if (request.getParameter("has") != null)
		{
			errorString.append(request.getParameter("has")+"道问题已存在！ \\n");
		}
		if (request.getParameter("nofix") != null)
		{
			errorString.append(request.getParameter("nofix")+"道问题格式不正确！ \\n");
		}
		if (request.getParameter("nofixid") != null)
		{
			errorString.append("已存在的问题为："+request.getParameter("nofixid")+" \\n");
		}	
		if (request.getParameter("nopassid") != null)
		{
			errorString.append("格式不对的问题为："+request.getParameter("nopassid")+" \\n");
		}	
		
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>添加问题</title>
		<link href="css/gl/tjwt.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src='dwr/engine.js'>
</script>
		<script type="text/javascript" src='dwr/util.js'>
</script>
		<script type="text/javascript" src="script/jquery/jquery-1.5.1.min.js"></script>
		<script type="text/javascript" src='dwr/interface/QuesDwr.js'>
</script>
		<script type="text/javascript" src='script/gl/tjwt.js'>
</script>
		<script type="text/javascript">
		function error()
		{ 
			if("<%=errorString.toString()%>".length>0)
			{
			 alert("<%=errorString.toString()%>");
			 ChangeNav("dr",$("#daoru"));
			}
		}
		$(function() {
			error();
		});
</script>
	</head>

	<body>

		<div id="page_all">
			<jsp:include page="title.jsp" flush="true">
				<jsp:param name="jspName" value="wtModuleOpt" />
			</jsp:include>
			<div id="main">
				<div id="tgleft">
					<jsp:include page="wtleft.jsp" flush="true">
						<jsp:param name="jspName" value="tjModuleOpt" />
					</jsp:include>
				</div>
				<div id="tgmain">
					<div id="tnav">
						<ul>
							<li>
								<span class="onfocus" onclick="ChangeNav('xz',this)">选择&nbsp;</span>
							</li>
							<li>
								<span class="losefocus" onclick="ChangeNav('tk',this)">填空</span>
							</li>
							<li>
								<span class="losefocus" onclick="ChangeNav('pd',this)">&nbsp;判断</span>
							</li>
							<li>
								<span class="losefocus" onclick="ChangeNav('jd',this)">&nbsp;&nbsp;简答</span>
							</li>
							<li>
								<span class="losefocus" id="daoru" onclick="ChangeNav('dr',this)">&nbsp;&nbsp;&nbsp;导入问题</span>
							</li>
						</ul>
					</div>
					<div id="xxpanel">
						<table id="xxtable" cellpadding="0" cellspacing="0">
							<tr>
								<td class="ftd">
									分&nbsp;类:
								</td>
								<td>
									<select id="kind">
									</select>
								</td>
							</tr>
							<tr>
								<td class="ftd" style="vertical-align: top;">
									问&nbsp;题:
								</td>
								<td>
									<textarea id="problem"
										onkeyup="this.value = this.value.substring(0, 200);"></textarea>
								</td>
							</tr>
							<tr>
								<td class="ftd">
									选&nbsp;项A:
								</td>
								<td>
									<input id="xxa" class="xuanx" maxlength="100">
								</td>
							</tr>
							<tr>
								<td class="ftd">
									选&nbsp;项B:
								</td>
								<td>
									<input id="xxb" class="xuanx" maxlength="100">
								</td>
							</tr>
							<tr>
								<td class="ftd">
									选&nbsp;项C:
								</td>
								<td>
									<input id="xxc" class="xuanx" maxlength="100">
								</td>
							</tr>
							<tr>
								<td class="ftd">
									选&nbsp;项D:
								</td>
								<td>
									<input id="xxd" class="xuanx" maxlength="100">
								</td>
							</tr>
							<tr>
								<td class="ftd">
									答&nbsp;案:
								</td>
								<td>
									<input name="xzda" type="checkbox" value="1" style="">
									A &nbsp;&nbsp;
									<input name="xzda" type="checkbox" value="2" style="">
									B &nbsp;&nbsp;
									<input name="xzda" type="checkbox" value="3" style="">
									C &nbsp;&nbsp;
									<input name="xzda" type="checkbox" value="4" style="">
									D
								</td>
							</tr>
							<tr>
								<td class="ftd">
									难&nbsp;度:
								</td>
								<td>
									<select id="xxlevel">
										<option value="1">
											容易
										</option>
										<option value="2">
											普通
										</option>
										<option value="3">
											困难
										</option>
									</select>
								</td>
							</tr>
						</table>
						<div class="bunpanel" style="">
							<img alt="" style="cursor: pointer;" src="img/gl/addbtn.jpg"
								onclick="AddXZ()" />
						</div>
					</div>
					<div id="tkpanel" style="display: none;">
						<table id="tktable" cellpadding="0" cellspacing="0">
							<tr>
								<td class="ftd">
									分&nbsp;类:
								</td>
								<td>
									<select id="tkkind">
									</select>
								</td>
							</tr>
							<tr>
								<td class="ftd" style="vertical-align: top;">
									问&nbsp;题:
								</td>
								<td>
									<textarea id="tkproblem"
										onkeyup="this.value = this.value.substring(0, 200);"></textarea>
								</td>
							</tr>
							<tr>
								<td class="ftd">
									答&nbsp;案:
								</td>
								<td>
									<input id="tkans" class="xuanx" maxlength="100">
								</td>
							</tr>
							<tr>
								<td class="ftd">
									难&nbsp;度:
								</td>
								<td>
									<select id="tklevel">
										<option value="1">
											容易
										</option>
										<option value="2">
											普通
										</option>
										<option value="3">
											困难
										</option>
									</select>
								</td>
							</tr>
						</table>
						<div class="tktj" style="">
							<img alt="" style="cursor: pointer;" src="img/gl/addbtn.jpg"
								onclick="AddTK()" />
						</div>
					</div>
					<div id="pdpanel" style="display: none;">
						<table id="pdtable" cellpadding="0" cellspacing="0">
							<tr>
								<td class="ftd">
									分&nbsp;类:
								</td>
								<td>
									<select id="pdkind">
									</select>
								</td>
							</tr>
							<tr>
								<td class="ftd" style="vertical-align: top;">
									问&nbsp;题:
								</td>
								<td>
									<textarea id="pdproblem"
										onkeyup="this.value = this.value.substring(0, 200);"></textarea>
								</td>
							</tr>
							<tr>
								<td class="ftd">
									答&nbsp;案:
								</td>
								<td>
									<select id="pdans">
										<option value="1">
											正确
										</option>
										<option value="0">
											错误
										</option>
									</select>
								</td>
							</tr>
							<tr>
								<td class="ftd">
									难&nbsp;度:
								</td>
								<td>
									<select id="pdlevel">
										<option value="1">
											容易
										</option>
										<option value="2">
											普通
										</option>
										<option value="3">
											困难
										</option>
									</select>
								</td>
							</tr>
						</table>
						<div class="tktj" style="">
							<img alt="" style="cursor: pointer;" src="img/gl/addbtn.jpg"
								onclick="AddPD()" />
						</div>
					</div>
					<div id="jdpanel" style="display: none;">
						<table id="jdtable" cellpadding="0" cellspacing="0">
							<tr>
								<td class="ftd">
									分&nbsp;类:
								</td>
								<td>
									<select id="jdkind">
									</select>
								</td>
							</tr>
							<tr>
								<td class="ftd" style="vertical-align: top;">
									问&nbsp;题:
								</td>
								<td>
									<textarea id="jdproblem"
										onkeyup="this.value = this.value.substring(0, 200);"></textarea>
								</td>
							</tr>
							<tr>
								<td class="ftd">
									答&nbsp;案:
								</td>
								<td>
									<textarea id="jdans"
										onkeyup="this.value = this.value.substring(0, 1500);"></textarea>
								</td>
							</tr>
							<tr>
								<td class="ftd">
									难&nbsp;度:
								</td>
								<td>
									<select id="jdlevel">
										<option value="1">
											容易
										</option>
										<option value="2">
											普通
										</option>
										<option value="3">
											困难
										</option>
									</select>
								</td>
							</tr>
						</table>
						<div class="bunpanel" style="">
							<img alt="" style="cursor: pointer;" src="img/gl/addbtn.jpg"
								onclick="AddJD()" />
						</div>
					</div>
					<form id="addQues" name="addQues" method="post" enctype="multipart/form-data"
						action="gl/addQues.do">
						<div id="drpanel" style="display: none;">
							<table id="pdtable" style="margin-top: 40px;" cellpadding="0"
								cellspacing="0">
								<tr>
									<td class="ftd">
										上传文件:
									</td>
									<td>
										<input type="file" id="excel" name="excel"
											style="width: 430px;height:22px;">
									</td>
								</tr>
							</table>
							<div class="tktj" style="">
								<img alt="" style="cursor: pointer;" src="img/gl/17.jpg"
									onclick="ImportQues()" />
							</div>
						</div>
					</form>
				</div>

			</div>
			<div id="footer">
				<jsp:include page="footer.jsp" flush="true"></jsp:include>
			</div>
		</div>

	</body>
</html>
